﻿using EntityModel;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace API.Controllers
{
    //同时为HttpGet方式时：
    //api/user/getall
    //api/user/getuserall
    [Route("api/[controller]")]
    [ApiController]
    public class UserController : ControllerBase
    {
        private readonly APIDBcontext db;
        public UserController(APIDBcontext context)
        {
            db = context;
        }

        /// <summary>
        /// 获取所有用户信息
        /// </summary>
        /// <returns></returns>
        [HttpGet("/getall")]
        public List<EmUser> GetAll()
        {
            return db.EmUser.ToList();
        }

        [HttpGet("/getuserall")]
        public List<EmUser> GetUserAll()
        {
            return db.EmUser.ToList();
        }


    }
}
